{include file="public/header" /}
<style>
    #two,#five{
        cursor:pointer;
        background: cornflowerblue;
        height: 30px;
        width: 60px;
        border-radius: 3px;
        text-align:center;
        line-height:30px;
        color: white;
    }
    #two{
        float:left;
    }
    #five{
        float:right;
        margin-left: 10px;
    }
    #chooseFirst{
        margin-bottom: 3px;
        height:30px;
        width: 130px;
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>充值</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label" style="text-align:left"><h2>首期款</h2></label>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">首期款：</label>
                            <div class="layui-input-block">
                                <!--<div id="chooseFirst">-->
                                    <!--<div id="two">1.98W</div>-->
                                    <!--<div id="five">5W</div>-->
                                <!--</div>-->
                                <input type="text" name="user_first_balance" placeholder="首期款，单位：元" class="layui-input" oninput="value=value.replace(/[^\-?\d.]/g,'')" value="">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label" style="text-align:left"><h2>货款</h2></label>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">货款：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_huo_balance" placeholder="货款，单位：元" class="layui-input" oninput="value=value.replace(/[^\-?\d.]/g,'')" value="">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">备注：</label>
                            <div class="layui-input-block">
                                <input type="text" name="integral_remark_huo" placeholder="备注" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label" style="width: 150px; text-align:left"><h2>其它款项</h2></label>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">金额：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_other_balance" placeholder="金额，单位：元" class="layui-input" oninput="value=value.replace(/[^\-?\d.]/g,'')" value="">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">备注：</label>
                            <div class="layui-input-block">
                                <input type="text" name="integral_remark" placeholder="备注" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label" style="text-align:left"><h2>押金</h2></label>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">押金：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_ya_price" placeholder="押金，单位：元" class="layui-input" oninput="value=value.replace(/[^\-?\d.]/g,'')" value="">
                            </div>
                        </div>

                        <input type="hidden" value="{$user_id}" name="user_id">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <!--<button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}

<script>
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('userRecharge')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        })
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
        $('#two').click(function () {
            $("input[name='user_first_balance']").val('19800');
        });
        $('#five').click(function () {
            $("input[name='user_first_balance']").val('50000');
        })
    });
</script>

</body>
</html>
